package com.itheima.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Method;

/**
 * @version 1.0  ctrl+o 删除多余的包导入
 * @description 说明
 * @package com.itheima.controller
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/hello")
    public String sayHello(){
        System.out.println("进入了sayHello...");
        return "Hello Eric Nice to meet you！";
    }

    public static void main(String[] args) throws Exception {
        Method sayHello = HelloController.class.getDeclaredMethod("sayHello");
        GetMapping annotation = sayHello.getAnnotation(GetMapping.class);
        String[] value = annotation.value();
        for (String s : value) {
            System.out.println("value: " + s);
        }
    }

}
